package com.skywolf.chem.usercenterapi.service.impl;

import com.skywolf.chem.article.entity.Article;
import com.skywolf.chem.article.entity.CollectionInfo;
import com.skywolf.chem.article.entity.Position;
import com.skywolf.chem.article.mapper.ArticleMapper;
import com.skywolf.chem.article.mapper.PositionMapper;
import com.skywolf.chem.pageconfig.entity.ColumnInfo;
import com.skywolf.chem.usercenterapi.service.IPositionService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author 
 * @since 2020-06-09
 */
@Service
public class PositionServiceImpl extends ServiceImpl<PositionMapper, Position> implements IPositionService {

    @Autowired
    PositionMapper positionMapper;

    @Autowired
    ArticleMapper articleMapper;

    @Override
    public ColumnInfo getColByAticleId(Long articleId) {
        return positionMapper.getColByAticleId(articleId);
    }

    @Override
    public List<Article> getArticleByColumnId(Long colId,Long articleId) {
        return articleMapper.getArticleByColumnId(colId,articleId);
    }

    @Override
    public List<Article> getRecommendnews(Long articleId) {
        return articleMapper.getRecommendnews(articleId);
    }

    @Override
    public int deletePosition(Long articleId) {
        return positionMapper.deletePosition(articleId);
    }
}
